LM335 Troubleshooting

Published in Electronics

The LM335 is a nice and simple temperature sensor to use ... until you make some mistakes. Having never used this type of sensor before, there were a few traps that I fell in and are worth repeating to let you (hopefully) get out of a rut more quickly.

If you're looking for a tutorial on how to wire this type of sensor up, have a look at Using the LM335 Temperature Sensor or just do a search for LM335 Arduino.

Symptoms

Output voltage is off the scale, but is still marginally lower than supply voltage

In this case the LM335's output voltage indicates a ridiculously high temperature, but it still seems to be sinking some voltage because the reading is less than supply Voltage. Also, the sensor might react slightly to changes in surrounding temperature.

Cause #1: Too great a supply voltage/current

The LM335-Z (TO-92 package) can only sink at most 10 mA, so too high a supply voltage or too low a value for the input resistor can saturate the little circuit's ability balance the V=IR equation and prevent it arriving at the correct voltage on the output pin. For a 3.3V input I found a 1 kΩ resistor works well, while for a 5V input a 2.0-2.2 kΩ resistor does the job.

Cause #2: It's plugged in backwards

With the LM335, grounding the calibration pin and leaving the real ground pin floating produces an interesting result - it will still sink a very small current through the calibration pin, and even reacts slightly to changes in temperature. This again means that the output voltage reads too high, but still is below the supply voltage. I made the mistake of skimming the data sheet too fast and mixing top-view and bottom-view pin diagrams. Thankfully this type of circuit is quite resilient to that sort of abuse, and will still work once correctly wired.

Output voltage is too low

Cause #1: Source voltage is too low

Make sure the source can drive the circuit to at least 3.3V. Much less than this can provide insufficient power to raise the output voltage to the required level.

Cause #2: Input resistor value is too high

Make sure the input resistor is something reasonable. For a 3.3V input I found a 1 kΩ resistor works well, while for a 5V input a 2.0-22 kΩ resistor does the job.

Output voltage is just slightly too high

Cause #1: Too much power is flowing, leading to self-heating

Try either using either a higher-valued input resistor (being aware to not drop the voltage that the sensor sees too much), or for a microcontroller based solution try supplying power to the sensor only when measuring instead of continuously.

Cause #2: The sensor is out of whack

I haven't found a solution for this one as such. The LM335 circuits that I have don't seem to have quite fallen within the 1 Kelvin uncalibrated tolerance stated by the data sheet, but I find it easier to compensate for this than troubleshoot it, either using a trim-pot on the calibration pin (as per the data sheet) or just building an adjustment into the software on the microcontroller. For the latter, you can use spare I/O lines as jumpers to provide a set of adjustment steps.